export default {
	// 示例1：格式化日期
	formatDate(date) {
		const d = new Date(date || Date.now());
		const year = d.getFullYear();
		const month = String(d.getMonth() + 1).padStart(2, '0');
		const day = String(d.getDate()).padStart(2, '0');
		const days = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
		const weekday = days[d.getDay()];
		return [year, month, day,weekday];
	},

	// 示例2：显示提示 Toast
	showToast(title, icon = 'none') {
		uni.showToast({
			title,
			icon,
			duration: 2000
		});
	},

	// 示例3：检查是否为空
	isEmpty(value) {
		return value === null || value === undefined || value === '';
	}
};